/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Gestores;

import Datos.DivorcioDB;
import Negocio.Canton;
import Negocio.Divorcio;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Dvid
 */
public class GestorDivorcio {
         public int grabar(Divorcio divorcio) {
        try {
            DivorcioDB divorcioDB = new DivorcioDB();
            divorcioDB.grabar(divorcio);
            return 0;
        } catch (SQLException ex) {
            return 1;
        }}

    public Divorcio buscar(int id) {
       Divorcio aux=null;
        try {
            
            DivorcioDB divorcioDB = new DivorcioDB();
            aux = divorcioDB.buscar(id);
            aux.setNumero(aux.getNumero());
            aux.setMatrimonio(aux.getMatrimonio());        
            aux.setFecha(aux.getFecha());           
        return aux;
        } catch (SQLException ex) {
            Logger.getLogger(Canton.class.getName()).log(Level.SEVERE, null, ex);
            return aux;
        }
    }
}
